import request from '/@/utils/request';

/**
 * 资源管理接口
 */
export function resourceApi() {
	return {
		addResource: (data?: object) => {
			return request({
				url: '/resource/add',
				method: 'post',
				data,
			});
		},
		deleteResource: (params?: object) => {
			return request({
				url: '/resource/delete',
				method: 'delete',
				data: params,
			});
		},
		pageResource: (data?: object) => {
			return request({
				url: '/resource/page',
				method: 'post',
				data,
			});
		},
		getPrivilege: (data?: object) => {
			return request({
				url: '/resource/getPrivilege',
				method: 'post',
				data,
			});
		},
		bindPrivilege: (data?: object) => {
			return request({
				url: '/resource/bindPrivilege',
				method: 'post',
				data,
			});
		},
		getOptions: (data?: object) => {
			return request({
				url: '/resource/options',
				method: 'post',
				data,
			});
		},
	};
}
